//获取ul
let uu = document.querySelector('#container #uu')
//1.发起请求获取列表数据

//2.根据列表数据展示列表内容

//3.需要将商品的productId绑定到元素上

//4.点击元素进行跳转,跳到detail页面 并且要携带productId
let id = getQueryString('productid');
console.log(id)
let el = "";
fetch('http://chst.vip:1234/api/getsitenav')
    //<a href="../pages/priceSearchListDetail.html?categoryid=${id}&productid=${item.productId}" class="clearfix">
    .then(body => body.json())
    .then(res => {
        console.log(res)
        res.result.forEach(item => {
            let regExp = /(?<=imgurl=)[^'"]*/;
            console.log(item)
            el += `<li>
            <a href="${item.navHref}">
                <img src="${item.navImg}" alt="">
                <span>${item.navTitle}</span>
            </a>
        </li>`
        })
        uu.innerHTML = el;
    })